<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="description" content="使用nagios搭建监控服务器"/>
    <meta name="keywords"
          content="nginx,freebsd,linux,mysql,shell,apache,centos,redhat,rhel,windows,sql,系统运维,IT运维,开源系统,开源系统运维"/>
    <title> 使用nagios搭建监控服务器 </title>

    <style>
        <!--
        /* Font Definitions */
        @font-face {
            font-family: 宋体;
            panose-1: 2 1 6 0 3 1 1 1 1 1;
        }

        @font-face {
            font-family: "Cambria Math";
            panose-1: 2 4 5 3 5 4 6 3 2 4;
        }

        @font-face {
            font-family: Calibri;
            panose-1: 2 15 5 2 2 2 4 3 2 4;
        }

        @font-face {
            font-family: "\@宋体";
            panose-1: 2 1 6 0 3 1 1 1 1 1;
        }

        /* Style Definitions */
        p.MsoNormal, li.MsoNormal, div.MsoNormal {
            margin: 0cm;
            margin-bottom: .0001pt;
            text-align: justify;
            text-justify: inter-ideograph;
            font-size: 10.5pt;
            font-family: "Calibri", "sans-serif";
        }

        p.MsoHeader, li.MsoHeader, div.MsoHeader {
            mso-style-link: "页眉 Char";
            margin: 0cm;
            margin-bottom: .0001pt;
            text-align: center;
            layout-grid-mode: char;
            border: none;
            padding: 0cm;
            font-size: 9.0pt;
            font-family: "Calibri", "sans-serif";
        }

        p.MsoFooter, li.MsoFooter, div.MsoFooter {
            mso-style-link: "页脚 Char";
            margin: 0cm;
            margin-bottom: .0001pt;
            layout-grid-mode: char;
            font-size: 9.0pt;
            font-family: "Calibri", "sans-serif";
        }

        a:link, span.MsoHyperlink {
            color: blue;
            text-decoration: underline;
        }

        a:visited, span.MsoHyperlinkFollowed {
            color: purple;
            text-decoration: underline;
        }

        span.Char {
            mso-style-name: "页眉 Char";
            mso-style-link: 页眉;
        }

        span.Char0 {
            mso-style-name: "页脚 Char";
            mso-style-link: 页脚;
        }

        span.ttag {
            mso-style-name: t_tag;
        }

        /* Page Definitions */
        @page Section1 {
            size: 595.3pt 841.9pt;
            margin: 72.0pt 90.0pt 72.0pt 90.0pt;
            layout-grid: 15.6pt;
        }

        div.Section1 {
            page: Section1;
        }

        -->
    </style>
</head>
<body style="" lang="ZH-CN" link="blue" vlink="purple">
<div id="menu">
    <ul>
		<span style="FONT-SIZE: 10.5pt">

			<li><a href="index.htm" hidefocus="true" id="mn_list">linux入门教程</a></li>

		</span>
    </ul>
</div>
<div class="Section1" style="layout-grid:15.6pt">
    <p class="MsoNormal" style="text-align:center" align="center"><b style="mso-bidi-font-weight:
normal"><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:
Calibri;mso-hansi-font-family:Calibri">第二十四章</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:15.0pt"> </span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:
Calibri;mso-hansi-font-family:Calibri">使用</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:15.0pt" lang="EN-US">Nagios</span></b><b style="mso-bidi-font-weight:normal"><span
            style="font-size:15.0pt;font-family:
宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">搭建监控服务器</span></b><b
            style="mso-bidi-font-weight:normal"><span style="font-size:15.0pt" lang="EN-US"><o:p></o:p></span></b></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">【<b style="mso-bidi-font-weight:normal">关于</b></span><b
            style="mso-bidi-font-weight:
normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">Nagios</span></b><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">】</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal" style="text-indent:21.0pt"><span style="mso-bidi-font-size:10.5pt"
                                                          lang="EN-US">Nagios</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">是一款用于监控系统和网络的开源应用软件，它的模式是服务器</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">—</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">客户端，也就是说首先要在在一台服务器上（</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">server</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">）部署相应的主要套件，然后在要监控的服务器上部署客户端程序，这样</span><span style="mso-bidi-font-size:10.5pt"
                                                                            lang="EN-US">server</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">会和</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">client</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">通信，从而监控</span><span style="mso-bidi-font-size:10.5pt"
                                                                                 lang="EN-US">client</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">端的各项资源。</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">Nagios</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">功能十分强大几乎所有的项目都可以监控，大到服务器的存活状态，小到服务器上的某一个服务（</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">web</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">）。这些功能都是通过自定义插件（或者叫做脚本）来实现。</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>


    <p class="MsoNormal" style="text-indent:21.0pt"><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">当</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">Nagios</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">监控到某项资源发生异常会通知到用户，你可以接入手机短信接口也可以接入邮件接口。我们可以通过</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">web</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">页面来查看</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">Nagios</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">所监控的各项资源，默认搭建的</span><span style="mso-bidi-font-size:10.5pt"
                                                          lang="EN-US">Nagios</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">服务器只能监控简单的几个项目，而其他服务之类的监控项目都是由我们自己开发的插件来实现的。</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">【<b style="mso-bidi-font-weight:normal">需要下载的软件</b>】</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">nagios-3.0.5
<span style="mso-spacerun:yes">&nbsp;</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">nagios-plugins-1.4.13
<span style="mso-spacerun:yes">&nbsp;</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">nrpe-2.12.tar.gz
<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">apache-2.2.11<span
            style="mso-spacerun:yes">&nbsp; </span><span style="mso-spacerun:yes">&nbsp;</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">// </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">以上软件版本可以不一样</span><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">【<b style="mso-bidi-font-weight:normal">监控中心</b></span><b
            style="mso-bidi-font-weight:
normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">Server</span></b><b
            style="mso-bidi-font-weight:normal"><span style="mso-bidi-font-size:10.5pt;
font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">端的配置</span></b><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">】</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">1. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">安装</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">apache </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">（略，请参考第</span><span style="mso-bidi-font-size:10.5pt"
                                                                                 lang="EN-US">16</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">章中相关内容，只需安装，到后边再配置）</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">2. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">建立</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">nagios</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">账户</span><span style="mso-bidi-font-size:10.5pt"
                                                                            lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">useradd<span
            style="mso-spacerun:yes">&nbsp;
</span>nagios<o:p></o:p></span></i></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">3. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">下载软件</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt"
                                                                     lang="EN-US">cd<span style="mso-spacerun:yes">&nbsp;
</span>/usr/local/src/<o:p></o:p></span></i></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">wget<span
            style="mso-spacerun:yes">&nbsp;
</span>http://syslab.comsenz.com/downloads/linux/nagios-3.0.5.tar.gz<o:p></o:p></span></i></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">wget<span
            style="mso-spacerun:yes">&nbsp;
</span>http://syslab.comsenz.com/downloads/linux/nagios-plugins-1.4.13.tar.gz<o:p></o:p></span></i></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">wget <span
            style="mso-spacerun:yes">&nbsp;</span>http://syslab.comsenz.com/downloads/linux/nrpe-2.12.tar.gz<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">4. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">编译安装</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">nagios<o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt"
                                                                     lang="EN-US">cd<span style="mso-spacerun:yes">&nbsp;
</span>/usr/local/src/<o:p></o:p></span></i></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt"
                                                                     lang="EN-US">tar<span style="mso-spacerun:yes">&nbsp;
</span>zxvf<span style="mso-spacerun:yes">&nbsp; </span>nagios-3.0.5.tar.gz<o:p></o:p></span></i></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt"
                                                                     lang="EN-US">cd<span style="mso-spacerun:yes">&nbsp;
</span>nagios-3.0.5<o:p></o:p></span></i></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">./configure<span
            style="mso-spacerun:yes">&nbsp; </span>--prefix=/usr/local/nagios<o:p></o:p></span></i></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">make all<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">make install<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">make install-init </span></i><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;</span># </span><span
            style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">把</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">nagios</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">做成一个运行脚本，使</span><span style="mso-bidi-font-size:10.5pt" lang="EN-US">nagios</span><span
            style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">随系统开机启动</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">make install-config<span
            style="mso-spacerun:yes">&nbsp; </span># </span></i><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">把配置文件样例复制到</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">nagios</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">的安装目录</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">make install-commandmode # </span></i><span
            style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">给外部命令访问</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">nagios</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">配置文件的权限</span><span style="mso-bidi-font-size:10.5pt"
                                                                                 lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">chown -R nagios:nagios /usr/local/nagios<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">5. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">编译安装</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">nagios-plugins<o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt"
                                                                     lang="EN-US">cd<span style="mso-spacerun:yes">&nbsp;
</span>/usr/local/src/<o:p></o:p></span></i></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">tar zxvf nagios-plugins-1.4.13.tar.gz<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt"
                                                                     lang="EN-US">cd<span style="mso-spacerun:yes">&nbsp;
</span>nagios-plugins-1.4.13<o:p></o:p></span></i></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">./configure<span
            style="mso-spacerun:yes">&nbsp; </span>--prefix=/usr/local/nagios
--with-nagios-user=nagios --with-nagios-group=nagios<o:p></o:p></span></i></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">make &amp;&amp; make install<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">查看是否安装成功的方法是：</span><span style="mso-bidi-font-size:10.5pt"
                                                                                       lang="EN-US"><o:p></o:p></span>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">ls /usr/local/nagios/libexec/<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">看这个目录下是否有插件文件</span><span style="mso-bidi-font-size:10.5pt"
                                                                                       lang="EN-US"><o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">6. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">安装</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">nrpe<o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">cd /usr/local/src/<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">tar zxvf<span
            style="mso-spacerun:yes">&nbsp;
</span></span></i><span style="mso-bidi-font-size:10.5pt" lang="EN-US">nrpe-2.12.tar.gz
<o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">cd nrpe-2.12<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">./configure --enable-ssl --enable-command-args<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">make all<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">make install-plugin<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">make install-daemon<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">make install-daemon-config<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">7. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">配置</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">web</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">接口</span><span style="mso-bidi-font-size:10.5pt"
                                                                            lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt"
                                                                     lang="EN-US">vim<span style="mso-spacerun:yes">&nbsp;
</span>/usr/local/apache2/conf/httpd.conf<o:p></o:p></span></i></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">在最后加入以下内容：</span><span style="mso-bidi-font-size:10.5pt"
                                                                                    lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">ScriptAlias
/nagios/cgi-bin /usr/local/nagios/sbin <o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">&lt;Directory
"/usr/local/nagios/sbin/"&gt;<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>AllowOverride
AuthConfig<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>Options ExecCGI<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>Order allow,deny<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>Allow from all<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">&lt;/Directory&gt;<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span
            style="mso-spacerun:yes">&nbsp; </span>Alias /nagios/ /usr/local/nagios/share/<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">&lt;Directory
"/usr/local/nagios/share"&gt;<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>Options None<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>AllowOverride
AuthConfig<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>Order allow,deny<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>Allow from all<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">&lt;/Directory&gt;<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">8. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">配置</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">nagios<o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt"
                                                                     lang="EN-US">cd<span style="mso-spacerun:yes">&nbsp;
</span>/usr/local/nagios/etc/<o:p></o:p></span></i></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">vim cgi.cfg<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">把</span><span style="mso-bidi-font-size:10.5pt"> <span
            lang="EN-US">use_authentication=1<span style="mso-spacerun:yes">&nbsp; </span></span></span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">改成</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp; </span>use_authentication=0<span
            style="mso-spacerun:yes">&nbsp; </span></span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">意思是不用用户验证</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">9. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">启动</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">nagios <o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">在启动前先检测一下：</span><span style="mso-bidi-font-size:10.5pt"
                                                                                    lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">/usr/local/nagios/bin/nagios -v
/usr/local/nagios/etc/nagios.cfg<o:p></o:p></span></i></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">如果最后显示如下，则说明配置没有问题了。</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">Total Warnings:
0<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">Total
Errors:<span style="mso-spacerun:yes">&nbsp;&nbsp; </span>0<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">启动命令：</span><span style="mso-bidi-font-size:10.5pt"
                                                                               lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">/etc/init.d/nagios start<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">或者：</span><span style="mso-bidi-font-size:10.5pt"
                                                                             lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">/usr/local/nagios/bin/nagios -d
/usr/local/nagios/etc/nagios.cfg<o:p></o:p></span></i></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">此时，就可以访问</span><span style="mso-bidi-font-size:10.5pt"
                                                                                  lang="EN-US">web</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">页面的</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">nagios</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">了，在浏览器中输入：</span><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">http://IP/nagios/
</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:
Calibri;mso-hansi-font-family:Calibri">看看吧。</span><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">【<b style="mso-bidi-font-weight:normal">在要监控的机器上</b></span><b
            style="mso-bidi-font-weight:
normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">client</span></b><b
            style="mso-bidi-font-weight:normal"><span style="mso-bidi-font-size:10.5pt;
font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">部署</span></b><b
            style="mso-bidi-font-weight:normal"><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">nagios</span></b><span style="mso-bidi-font-size:10.5pt;font-family:
宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">】</span><b style="mso-bidi-font-weight:normal"><span
            style="mso-bidi-font-size:
10.5pt" lang="EN-US"><o:p></o:p></span></b></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">如果你打开了</span><span style="mso-bidi-font-size:10.5pt"
                                                                                lang="EN-US">web</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">页面，点击左栏的</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">Host Detail </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">会在右栏看到一行数据，其中</span><span style="mso-bidi-font-size:10.5pt"
                                                         lang="EN-US">Host </span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">名为</span><span
            style="mso-bidi-font-size:10.5pt"> <span lang="EN-US">“localhost” </span></span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">，</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">Status</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">显示为</span><span style="mso-bidi-font-size:10.5pt"
                                                                             lang="EN-US">”up”</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">，并且显示为绿色，如果是其他颜色就说明你的</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">localhost</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">出了问题。目前只有一行数据，也就是说只监控了监控中心（</span><span style="mso-bidi-font-size:10.5pt" lang="EN-US">localhost</span><span
            style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">）一台主机，那么如何添加其他机器被它监控呢？这就需要在要被监控的机器上也部署</span><span style="mso-bidi-font-size:10.5pt"
                                                                                  lang="EN-US">nagios</span><span
            style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">软件。</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">1. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">添加账户</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">useradd nagios<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">2. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">安装</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">nrpe<o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">cd /usr/local/src/<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">wget<span
            style="mso-spacerun:yes">&nbsp;
</span>http://syslab.comsenz.com/downloads/linux/nrpe-2.12.tar.gz<o:p></o:p></span></i></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">tar zxvf<span
            style="mso-spacerun:yes">&nbsp;
</span></span></i><span style="mso-bidi-font-size:10.5pt" lang="EN-US">nrpe-2.12.tar.gz
<o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">cd nrpe-2.12<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">./configure --enable-ssl
--enable-command-args<o:p></o:p></span></i></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">make all<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">make install-plugin<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">make install-daemon<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">make install-daemon-config<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">3. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">安装</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">nagios-plugin<o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt"
                                                                     lang="EN-US">cd<span style="mso-spacerun:yes">&nbsp;
</span>/usr/local/src/<o:p></o:p></span></i></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">wget http://syslab.comsenz.com/downloads/linux/nagios-plugins-1.4.13.tar.gz<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">tar zxvf nagios-plugins-1.4.13.tar.gz<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt"
                                                                     lang="EN-US">cd<span style="mso-spacerun:yes">&nbsp;
</span>nagios-plugins-1.4.13<o:p></o:p></span></i></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">./configure<span
            style="mso-spacerun:yes">&nbsp; </span>--prefix=/usr/local/nagios
--with-nagios-user=nagios --with-nagios-group=nagios<o:p></o:p></span></i></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">make &amp;&amp; make install<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">到此就算安装完成了，请查看</span><span style="mso-bidi-font-size:10.5pt"
                                                                                       lang="EN-US">/usr/local/nagios/</span><span
            style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">目录下是否有四个目录分别为：</span><span style="mso-bidi-font-size:10.5pt" lang="EN-US">bin<span
            style="mso-spacerun:yes">&nbsp;
</span>etc<span style="mso-spacerun:yes">&nbsp; </span>libexec<span style="mso-spacerun:yes">&nbsp; </span>share </span><span
            style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">另外在</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">libexec</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">目录下会有很多</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">check_</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">开头的文件。如果你的机器上没有，就请重新安装吧。</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">4. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">配置</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">vim /usr/local/nagios/etc/nrpe.cfg<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">找到</span><span style="mso-bidi-font-size:10.5pt"
                                                                            lang="EN-US">”allowed_hosts=127.0.0.1” </span><span
            style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">改成</span><span style="mso-bidi-font-size:10.5pt">
<span lang="EN-US">“allowed_hosts=127.0.0.1,10.0.4.67” <o:p></o:p></span></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">// </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">后边的</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">IP</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">是</span><span style="mso-bidi-font-size:10.5pt"
                                                                           lang="EN-US">server</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">的</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">IP<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">找到</span><span style="mso-bidi-font-size:10.5pt"
                                                                            lang="EN-US">”</span><span
            lang="EN-US"> </span><span style="mso-bidi-font-size:10.5pt" lang="EN-US">dont_blame_nrpe=0” </span><span
            style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">改成</span><span style="mso-bidi-font-size:10.5pt">
<span lang="EN-US">“dont_blame_nrpe=1”<o:p></o:p></span></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">5. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">启动</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">nrpe<o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">/usr/local/nagios/bin/nrpe -c
/usr/local/nagios/etc/nrpe.cfg -d<o:p></o:p></span></i></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">【<b
            style="mso-bidi-font-weight:normal">在监控中心添加被监控主机</b>】</span><span style="mso-bidi-font-size:10.5pt"
                                                                              lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">添加主机当然是要到</span><span style="mso-bidi-font-size:10.5pt"
                                                                                   lang="EN-US">server</span><span
            style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">端（监控中心）修改配置文件了。</span><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">1. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">修改主配置文件</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt"
                                                                     lang="EN-US">cd<span style="mso-spacerun:yes">&nbsp;
</span>/usr/local/nagios/etc/<o:p></o:p></span></i></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">vim nagios.cfg<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">增加内容：</span><span style="mso-bidi-font-size:10.5pt"
                                                                               lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt"
                               lang="EN-US">cfg_dir=/usr/local/nagios/etc/services<span style="mso-spacerun:yes">&nbsp;&nbsp; </span>##</span><span
            style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">定义一个目录，以后把新增加的主机信息文件全部放到这里</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">2. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">添加被监控主机信息</span><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">mkdir /usr/local/nagios/etc/services<o:p></o:p></span></i>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt"
                                                                     lang="EN-US">cd<span style="mso-spacerun:yes">&nbsp;
</span>/usr/local/nagios/etc/services<o:p></o:p></span></i></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt"
                                                                     lang="EN-US">vim<span style="mso-spacerun:yes">&nbsp;
</span>10.0.4.56.cfg </span></i><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;</span></span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">加入如下内容：</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">define
host{<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>use<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;
</span>linux-server<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>host_name<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>10.0.4.56<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>alias<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>10.0.4.56<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>address<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>10.0.4.56<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">}<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">define
service{<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>use<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;
</span>generic-service<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>host_name<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>10.0.4.56<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>service_description<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>check_ping<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>check_command<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>check_ping!100.0,20%!200.0,50%<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>max_check_attempts 5<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>normal_check_interval 1<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">}<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">define
service{<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span
            style="mso-spacerun:yes">&nbsp;</span><span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>use<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>generic-service<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>host_name<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>10.0.4.56<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>service_description<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>check_ssh<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>check_command<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>check_ssh<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>max_check_attempts 5<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>normal_check_interval 1<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">}<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">define
service{<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>use<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;
</span>generic-service<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>host_name<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>10.0.4.56<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>service_description<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>check_http<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>check_command<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>check_http<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>max_check_attempts 5<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>normal_check_interval 1<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">}<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">// </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">注意，这里的</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">IP</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">是</span><span style="mso-bidi-font-size:10.5pt"
                                                                           lang="EN-US">client</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">端的</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">IP</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">，监控的项目有三个</span><span style="mso-bidi-font-size:10.5pt"
                                                                                   lang="EN-US">ping, ssh, http</span><span
            style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">。其实这三个项目使用的脚本都为本地脚本，也就是说，即使远程主机没有安装</span><span style="mso-bidi-font-size:10.5pt"
                                                                               lang="EN-US">nagios</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">和</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">nrpe</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">同样可以监控这些项目。但是如果想监控</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">load</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">，</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">disk</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">，等等就需要通过</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">nrpe</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">服务来搞定了，道理很简单，</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">load</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">和</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">disk</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">都需要登录到远程主机上去获得信息，而</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">ping</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">，</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">ssh</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">，</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">http</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">都不需要的。这个到远程主机获取相关的信息的过程是由</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">nrpe</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">完成的。如果你的</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">client</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">上没有启动</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">nrpe</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">服务那么我们是无法获取远程主机的</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">load</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">和</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">disk</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">等信息的。下面笔者配置一下使用</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">nrpe</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">来监控远程主机的相关项目。</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">在</span><span style="mso-bidi-font-size:10.5pt"
                                                                           lang="EN-US">server</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">端编辑</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">/usr/local/nagios/etc/objects/commands.cfg<o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt"
                                                                     lang="EN-US">vim<span style="mso-spacerun:yes">&nbsp;
</span>/usr/local/nagios/etc/objects/commands.cfg<span style="mso-spacerun:yes">&nbsp; </span></span></i><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"># </span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">在最后面添加如下内容</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">define
command{<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>command_name<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;
</span>check_nrpe<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>command_line<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;
</span>$USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">然后编辑</span><span style="mso-bidi-font-size:10.5pt"
                                                                              lang="EN-US">10.0.4.56.cfg </span><span
            style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">（还是</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">server</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">上）</span><span style="mso-bidi-font-size:10.5pt"
                                                                            lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt"
                                                                     lang="EN-US">cd<span style="mso-spacerun:yes">&nbsp;&nbsp;
</span>/usr/local/nagios/etc/services<o:p></o:p></span></i></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt"
                                                                     lang="EN-US">vim<span style="mso-spacerun:yes">&nbsp;
</span>10.0.4.56.cfg<span style="mso-spacerun:yes">&nbsp;&nbsp; </span></span></i><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"># </span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">加入如下内容：</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">define
service{<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>use<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;
</span>generic-service<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>host_name<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>10.0.4.56<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>service_description<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>check_load<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>check_command<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>check_nrpe!check_load<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>max_check_attempts 5<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>normal_check_interval 1<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">}<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">define
service{<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>use<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;
</span>generic-service<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>host_name<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>10.0.4.56<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>service_description<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>check_disk_hda1<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>check_command<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>check_nrpe!check_hda1<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>max_check_attempts 5<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>normal_check_interval 1<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">}<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">define
service{<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>use<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;
</span>generic-service<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>host_name<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>10.0.4.56<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>service_description<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>check_disk_hda2<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>check_command<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>check_nrpe!check_hda2<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>max_check_attempts 5<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>normal_check_interval
1<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">}<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">// </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">这里需要解释一下相关的</span><span style="mso-bidi-font-size:10.5pt"
                                                       lang="EN-US">”check_command”, </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">先看这个</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">” check_nrpe!check_load” </span><span style="mso-bidi-font-size:10.5pt;
font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">这里的</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">check_nrpe</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">就是上面</span><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt"
                                                                                      lang="EN-US">/usr/local/nagios/etc/objects/commands.cfg</span></i><span
            style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">中刚刚定义的，后面的</span><span style="mso-bidi-font-size:10.5pt"
                                                      lang="EN-US">check_load</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">是在远程主机上定义的一个命令脚本。具体在哪里定义稍后介绍。为什么中间加一个</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">”!”</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">，这个是</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">nagios</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">特有的形式，无需关心。下面需要到远程主机上去定义上面用到的脚本了。</span><span style="mso-bidi-font-size:10.5pt"
                                                                             lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">在远程主机上编辑</span><i style="mso-bidi-font-style:normal"><span
            style="mso-bidi-font-size:
10.5pt" lang="EN-US">/usr/local/nagios/etc/nrpe.cfg </span></i><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">文件</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">vim <span
            style="mso-spacerun:yes">&nbsp;</span>/usr/local/nagios/etc/nrpe.cfg </span></i><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">(client</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">上</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">)<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">把</span><span style="mso-bidi-font-size:10.5pt"
                                                                           lang="EN-US">”</span><span
            lang="EN-US"> </span><span style="mso-bidi-font-size:10.5pt" lang="EN-US">command[check_hda1]”</span><span
            style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">那行改成：</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">command[check_hda1]=/usr/local/nagios/libexec/check_disk
-w 20% -c 10% -p /dev/hda1<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">然后再增加一行：</span><span style="mso-bidi-font-size:10.5pt"
                                                                                  lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">command[check_hda2]=/usr/local/nagios/libexec/check_disk
-w 20% -c 10% -p /dev/hda2<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">// </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">这里的</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">check_hda1 </span><span style="mso-bidi-font-size:10.5pt;font-family:
宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">和</span><span style="mso-bidi-font-size:10.5pt"
                                                                              lang="EN-US"> check_hda2 </span><span
            style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">都是自定义的，和</span><span style="mso-bidi-font-size:10.5pt" lang="EN-US">server</span><span
            style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">端的定义的</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">service</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">中的</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">check_command</span><span style="mso-bidi-font-size:10.5pt;font-family:
宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">对应。也就是说，如果在</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">server</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">端定义了一个</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">service</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">（通过</span><span style="mso-bidi-font-size:10.5pt"
                                                                             lang="EN-US">nrpe</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">方式）那么必须要在客户端上的</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">nrpe.cfg</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">中定义相应的脚本。保存这个文件后，需要重新启动一下</span><span style="mso-bidi-font-size:10.5pt"
                                                                     lang="EN-US">nrpe</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">服务。</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">killall nrpe ; /usr/local/nagios/bin/nrpe -c
/usr/local/nagios/etc/nrpe.cfg -d </span></i><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">（</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">client</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">上）</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">3. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">重启</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">nagios</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">服务</span><span style="mso-bidi-font-size:10.5pt"
                                                                            lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">修改了配置需要重启服务才能使添加的监控主机生效。</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">/etc/init.d/nagios<span
            style="mso-spacerun:yes">&nbsp; </span>restart<span style="mso-spacerun:yes">&nbsp; </span></span></i><span
            style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">（</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">server</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">上）</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">此时再到</span><span style="mso-bidi-font-size:10.5pt"
                                                                              lang="EN-US">web</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">页面去观察是否多了一台</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">10.0.4.56 <o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">【<b style="mso-bidi-font-weight:normal">在</b></span><b
            style="mso-bidi-font-weight:
normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">nagios</span></b><b
            style="mso-bidi-font-weight:normal"><span style="mso-bidi-font-size:10.5pt;
font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">客户端上自定义监控脚本</span></b><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">】</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">在开始，笔者就讲过，我们可以自定义写监控脚步，从上面的例子中也可以看到监控磁盘状态时，是根据磁盘分区来监控的。这样不免有些麻烦，因为每台主机的磁盘分区状况都不一样（一样还好），而且有多少个分区就需要定义多少个命令。所以笔者就自定义写一个</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">shell</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">脚本来监控所有的磁盘分区：</span><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">1. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">在客户端上创建脚本</span><i style="mso-bidi-font-style:
normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">/usr/local/nagios/libexec/check_disk.sh</span></i><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">vim <span
            style="mso-spacerun:yes">&nbsp;</span>/usr/local/nagios/libexec/check_disk.sh </span></i><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">写入如下内容：</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">(client</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">上</span><span style="mso-bidi-font-size:10.5pt"
                                                                           lang="EN-US">)<i style="mso-bidi-font-style:
normal"><o:p></o:p></i></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">#!/bin/bash<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">row=`df
-h -P|wc -l`<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">status=0<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">for i in
`seq 2 $row`<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">do<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>spare=`df -h -P|sed -n "$i"p|awk '{print $4}'`<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>use_percentage=`df -h -P|sed -n "$i"p|sed -n
"s/\%//"p|awk '{print $5}'`<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>spare_percentage=`expr 100 - $use_percentage`<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp; </span><span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;</span>partition_name=`df -h -P|sed
-n "$i"p|awk '{print $6}'`<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>if [
"$spare_percentage" -lt "3"<span style="mso-spacerun:yes">&nbsp; </span>];then<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>echo -n "$partition_name CRITICAL ${spare_percentage}% $spare<span style="mso-spacerun:yes">&nbsp; </span>"<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>status[$i]=2<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>elif
[ "$spare_percentage" -lt "5" ];then<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>echo -n<span style="mso-spacerun:yes">&nbsp;
</span>"$partition_name WARNING! ${spare_percentage}% $spare<span style="mso-spacerun:yes">&nbsp; </span>"<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>status[$i]=1<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>else<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>echo -n<span style="mso-spacerun:yes">&nbsp;
</span>"$partition_name OK ${spare_percentage}% $spare<span style="mso-spacerun:yes">&nbsp; </span>"<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>status[$i]=0<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>fi<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">done<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">zhuangtai=0<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">for j in
`seq 2 $row`<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">do<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>if [
"${status[$j]}" -gt "$zhuangtai"<span style="mso-spacerun:yes">&nbsp; </span>];then<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>zhuangtai=${status[$j]}<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>fi<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">done<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">exit
$zhuangtai<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">2. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">保存后，修改该脚本的权限</span><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">chmod +x <span
            style="mso-spacerun:yes">&nbsp;</span>/usr/local/nagios/libexec/check_disk.sh </span></i><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">（</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">client</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">上）</span><span style="mso-bidi-font-size:10.5pt"
                                                                            lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">3. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">然后编辑</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">/usr/local/nagios/etc/nrpe.cfg</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">文件</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">vim /usr/local/nagios/etc/nrpe.cfg <span
            style="mso-spacerun:yes">&nbsp;</span></span></i><span style="mso-bidi-font-size:10.5pt"
                                                                   lang="EN-US"># </span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">加入一行：（</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">client</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">上）</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">command[check_disk]=/usr/local/nagios/libexec/check_disk.sh<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">保存，重启</span><span style="mso-bidi-font-size:10.5pt"
                                                                               lang="EN-US">nrpe</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">服务</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">killall nrpe ; /usr/local/nagios/bin/nrpe -c
/usr/local/nagios/etc/nrpe.cfg -d </span></i><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">（</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">client</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">上）</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">4. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">检测刚才的脚本是否正常运行的方法是，到</span><span style="mso-bidi-font-size:10.5pt"
                                                               lang="EN-US">server</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">端执行如下命令：</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">/usr/local/nagios/libexec/check_nrpe -H
10.0.4.56 -c check_disk</span></i><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"> </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">（</span><span style="mso-bidi-font-size:10.5pt"
                                                                           lang="EN-US">server</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">上）</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">如果正常的话，会输出一行磁盘检测的数据，否则可能会报错。</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">5. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">到</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">server</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">上添加相应的</span><span style="mso-bidi-font-size:10.5pt"
                                                                                lang="EN-US">service<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt"
                                                                     lang="EN-US">cd<span style="mso-spacerun:yes">&nbsp;&nbsp;
</span>/usr/local/nagios/etc/services<span style="mso-spacerun:yes">&nbsp;
</span></span></i><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">（</span><span style="mso-bidi-font-size:10.5pt"
                                                                           lang="EN-US">server</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">上）</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt"
                                                                     lang="EN-US">vim<span style="mso-spacerun:yes">&nbsp;
</span>10.0.4.56.cfg<span style="mso-spacerun:yes">&nbsp;&nbsp; </span></span></i><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"># </span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">加入如下内容：</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">define
service{<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>use<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;
</span>generic-service<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>host_name<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>10.0.4.56<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>service_description<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>check_disk<o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>check_command<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>check_nrpe!check_disk<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>max_check_attempts 5<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>normal_check_interval 1<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">}<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">6. </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">重启</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">nagios</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">服务</span><span style="mso-bidi-font-size:10.5pt"
                                                                            lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">/etc/init.d/nagios restart<span
            style="mso-spacerun:yes">&nbsp;&nbsp; </span></span></i><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">（</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">server</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">上）</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">【<b style="mso-bidi-font-weight:normal">配置</b></span><b
            style="mso-bidi-font-weight:
normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">nagios</span></b><b
            style="mso-bidi-font-weight:normal"><span style="mso-bidi-font-size:10.5pt;
font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">报警邮件</span></b><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">】</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">现在</span><span style="mso-bidi-font-size:10.5pt"
                                                                            lang="EN-US">139</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">邮箱有顺便发短信的功能，所以当有报警时，只需发送到你的</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">139</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">邮箱你就同样会收到一条报警短信。这样做的优势就是不用再去买短信网关了，节省了很大一笔钱。</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">vim
/usr/local/nagios/etc/objects/contacts.cfg<o:p></o:p></span></i></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">把</span><span style="mso-bidi-font-size:10.5pt"
                                                                           lang="EN-US">”</span><span
            lang="EN-US"> </span><span style="mso-bidi-font-size:10.5pt" lang="EN-US">email<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
            style="mso-spacerun:yes">&nbsp;</span><span style="mso-spacerun:yes">&nbsp;</span>nagios@localhost”<span
            style="mso-spacerun:yes">&nbsp; </span></span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">修改成</span><span
            style="mso-bidi-font-size:10.5pt"> <span lang="EN-US">“email<span
            style="mso-spacerun:yes">&nbsp;&nbsp; </span></span></span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">你的</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">139</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">邮箱</span><span style="mso-bidi-font-size:10.5pt"
                                                                            lang="EN-US">”<o:p></o:p></span></p>

    <p class="MsoNormal"><i style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">vim
/usr/local/nagios/etc/objects/templates.cfg<o:p></o:p></span></i></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">找到：</span><span style="mso-bidi-font-size:10.5pt"
                                                                             lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;
color:red" lang="EN-US">define service{<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;
color:red" lang="EN-US"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>name<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>generic-service<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">之所以看这一段，是因为在上面添加的</span><i
            style="mso-bidi-font-style:normal"><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">10.0.4.56.cfg </span></i><span style="mso-bidi-font-size:10.5pt;
font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">定义了很多</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">generic-service</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">所以要关注这段的配置。</span><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">define
service{<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">name<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>generic-service<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">active_checks_enabled<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>1<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">passive_checks_enabled<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>1<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">parallelize_check<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>1<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">obsess_over_service<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>1<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">check_freshness<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>0<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">notifications_enabled<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>1<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">event_handler_enabled<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>1<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">flap_detection_enabled<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>1<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">failure_prediction_enabled<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>1<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">process_perf_data<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>1<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">retain_status_information
<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>1<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">retain_nonstatus_information<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>1<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">is_volatile<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>0<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">check_period<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>24x7<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">max_check_attempts<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>3<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">normal_check_interval<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>10<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">retry_check_interval<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>2<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">ontact_groups<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>admins<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">notification_options<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>w,u,c,r<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">notification_interval<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>60<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">notification_period<span
            style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>24x7<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">register<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>0<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">}<o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">其中有几个参数需要你注意：</span><span style="mso-bidi-font-size:10.5pt"
                                                                                       lang="EN-US"><o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">notifications_enabled
: </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:
Calibri;mso-hansi-font-family:Calibri">是否开启提醒功能。</span><span style="mso-bidi-font-size:10.5pt"
                                                             lang="EN-US">1</span><span style="mso-bidi-font-size:10.5pt;
font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">为开启，</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">0</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">为禁用。一般，这个选项会在主配置文件（</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">nagios.cfg</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">）中定义，效果相同。</span><span style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span>
    </p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">notification_interval:
</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:
Calibri;mso-hansi-font-family:Calibri">重复发送提醒信息的最短间隔时间。默认间隔时间是</span><span style="mso-bidi-font-size:10.5pt"
                                                                           lang="EN-US">60</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">分钟。如果这个值设置为</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">0</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">，将不会发送重复提醒。</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">notification_period:
</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:
Calibri;mso-hansi-font-family:Calibri">发送提醒的时间段。非常重要的主机（服务）我定义为</span><span style="mso-bidi-font-size:10.5pt"
                                                                            lang="EN-US">7</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">×</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">24</span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">，一般的主机（服务）就定义为上班时间。如果不在定义的时间段内，无论什么问题发生，都不会发送提醒。</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt" lang="EN-US">notification_options:
</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:
Calibri;mso-hansi-font-family:Calibri">这个参数定义了发送提醒包括的情况：</span><span style="mso-bidi-font-size:10.5pt"
                                                                     lang="EN-US">d = </span><span style="mso-bidi-font-size:
10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">状态为</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">DOWN, u = </span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">状态为</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">UNREACHABLE , r = </span><span style="mso-bidi-font-size:10.5pt;
font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">状态恢复为</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US">OK ,<span style="mso-spacerun:yes">&nbsp; </span>f = flapping</span><span
            style="mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri">。，</span><span style="mso-bidi-font-size:
10.5pt" lang="EN-US">n=</span><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">不发送提醒。</span><span style="mso-bidi-font-size:10.5pt"
                                                                                lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span style="mso-bidi-font-size:10.5pt;font-family:宋体;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri">要想正确发送邮件，上面的参数得配置合理才行。</span><span
            style="mso-bidi-font-size:10.5pt" lang="EN-US"><o:p></o:p></span></p>

    <p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>

    <p><span style="FONT-SIZE: 10.5pt;">上一页&nbsp;<a title="" href="23.htm">配置Samba服务器</a></span><span
            style="FONT-SIZE: 10.5pt;">&nbsp;&nbsp;</span></p>
    <p><span style="FONT-SIZE: 10.5pt;"><a title="" href="index.htm">回到主目录</a></span></p>

</div>
</body>
</html>